from rest_framework.pagination import PageNumberPagination, LimitOffsetPagination, CursorPagination


class MyPagination(PageNumberPagination):
    # xxxx?page=1&size=2   page：页数  size: 条数
    page_size = 10  # 每页显示1个
    page_query_param = "page"  # 第几页
    page_size_query_param = "size"  # 每页显示条数
    max_page_size = 1000  # 每页最多显示3个



# class MyPagination(LimitOffsetPagination):
#     # offset：从哪里开始，limit：找几个
#     # ?limit=2&offset=2
#     default_limit = 1
#     limit_query_param = "limit"
#     offset_query_param = "offset"
#     max_limit = 3



# class MyPagination(CursorPagination):
#     # 游标分页
#     cursor_query_param = "cursor"
#     page_size = 2
#     ordering = "-id"






